if __name__ == '__main__':
    i_before = 1
    i = 1
    j = 0
    sum = 0
    while i < 4000000:
        j = i + i_before
        i_before = i
        i = j
        if j % 2 == 0:
            sum += j
    print(sum)